//会话层，只有一个tcp服务器-->进行基本的tcp管理
#include "TcpServer.hpp" 
//能够读到http字符串
#include "Http.hpp"

// ./tcpserver 8888
int main(int argc, char *argv[])
{
  if (argc != 2)
  {
    std::cerr << "Usage: " << argv[0] << " local-port" << std::endl;
    exit(0);
  }
  uint16_t port = std::stoi(argv[1]);

  HttpServer hserver;

  // //构建TCP服务器
  std::unique_ptr<TcpServer> tsvr = std::make_unique<TcpServer>(
    std::bind(&HttpServer::HandlerHttpRequest, 
      &hserver, std::placeholders::_1), 
      port);
  tsvr->Loop();

  return 0;
}

